<?php
    require_once "config.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Hotels With Offers</title>

<script language="Javascript" type="text/javascript" src="js/jquery.min.js"></script>

<script language="Javascript" type="text/javascript" src="js/jquery.countdown.js"></script>
<link href="css/jquery.countdown.css" rel="stylesheet" type="text/css" />

<link href="css/main.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
         /*$(function(){
          <?php
//               $offer_hour = substr($offer_details['offer_end_date'], 11, 2) ;
//               $offer_min =  substr($offer_details['offer_end_date'], 14, 2);
//               $offer_sec =  substr($offer_details['offer_end_date'], 17, 2);
//               $offer_day =  substr($offer_details['offer_end_date'], 8, 2);
//               $offer_month = substr($offer_details['offer_end_date'], 5, 2);
//               $offer_year =  substr($offer_details['offer_end_date'], 0, 4);
               ?>
        var austDay = new Date(<?//=$offer_year?>,<?//=($offer_month-1)?>,<?//=$offer_day?>,<?//=$offer_hour?>,<?//=$offer_min?>,<?//=$offer_sec?>);
	$('#countdown').countdown({until: austDay});

<?php


        ?>

      });*/



		</script>
</head>

<body>
<div id="wrapper">
    <?php require_once 'top_header.php'; ?>
    
<div class="contentPane">
  <div id="sidebar">
    <span class="menu"><img src="images/call.png" alt="Advertise with Hotel with Offers" class="callus"  /></span>
    <div class="joinus">
      <h1>INVITE A FRIEND</h1>
      <h2>Tell a friend and win Rs100.00</h2>
      <div class="joinbtn"><a href="#">LEARN&nbsp;MORE</a></div>
     </div>
    <div class="reserve"><span class="reserveitem">Reserved for :</span> <span class="reserveitem">advertising</span> <span class="reserveitem">latest news</span> <span class="reserveitem">soon ending deals &amp; offers</span></div>
  </div>
  <div class="leftPane">
      <div class="mainMenu"><?php require_once 'main_menu.php'; ?></div>
     <?php //require_once 'newsletter_plug.php'; ?>
    <div id="Listings">
      <div class="listingdetails">
          <?php
          	$hotel_obj = new Hotels();
                $offer_obj = new Offer();
    		list($offer_details, $pagination_links) = $hotel_obj->listHotels();
                
    		echo $pagination_links;
    	?>
    		<table width="100%" border="0">
    	<?php
    		foreach ($offer_details as $offers)
    		{
    			$country = $hotel_obj->getCountryById($offers['country_id']);
    			$you_saved = number_format(floor($offers['regular_amount'] - $offers['discount_amount']));
    			$offer_img=$offer_obj->get_offer_images($offers['offer_id']);
                        $offer_image=!empty($offer_img[0]['image_name'])?$offer_img[0]['image_name']:"King_Park.jpg";
                        $offers_sold=$offer_obj->get_noof_sold_items($offers['offer_id']);
                        
    	?>
    			<tr>
                              
    				<td width="15%"><img width="120" height="90" src="images/hotels/thumbs/<?php echo $offer_image; ?>" /></td>
                                
    				<td width="50%" valign="top">
    					<p><a href="listing.php?offer_prefix=<?php echo $offers['offer_prefix']; ?>"><b><?php echo $offers['hotel_name']; ?></b></a></p>
    					<p style="padding: 0 10px 0 10px;"><?php echo substr($offers['hotel_description'], 0, 150) . "..."; ?></p>
    				</td>
    				<td width="20%" valign="top">   					
    					<span class="normalprice_small">Normal Price</span> <br />
    					<span class="normalprice_big">RS. <?php echo $offers['regular_amount']; ?></span> <br />   									<span class="discount_small">You save</span> <br />
    					<span class="discount_big">RS. <?php echo $offers['regular_amount']; ?></span>
    				</td>
    				<td width="15%">
                                    <div class="moreinfo" style="padding: 0 0 0 2px;"><a href="javascript()">SOLD <?php echo $offers_sold; ?></a></div>
                                    <div class="moreinfo" style="padding: 5px 10px 0 0;"><a href="listing.php?offer_prefix=<?php echo $offers['offer_prefix']; ?>">more info</a></div>
                                    <div class="moreinfo" style="padding: 5px 10px 0 0;"><a href="buynow.php?offer_prefix=<?php echo $offers['offer_prefix']?>">buy now</a><br>
                                            <script>function fbs_click() {u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}</script><style> html .fb_share_link { padding:2px 0 0 20px; height:16px; background:url(http://static.ak.facebook.com/images/share/facebook_share_icon.gif?6:26981) no-repeat top left; }</style><a rel="nofollow" href="http://www.facebook.com/share.php?u=http://www.hotelswithoffers.com/<?php echo $offers['offer_prefix']?>.html" onclick="return fbs_click()" target="_blank" class="fb_share_link"></a>
               <a href="https://twitter.com/share?url=http://www.hotelswithoffers.com/<?php echo $offers['offer_prefix']?>.html" class="twitter-share-button" data-lang="en">Tweet</a>
               <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
                                        </div>
    				</td>
    			</tr>
    			<tr>
    				<td colspan="4" style="line-height: 10px;">&nbsp;</td>
    			</tr>
    	<?php		
    		}
          ?>
          </table>
          <?php echo $pagination_links; ?>
      </div>

    </div>
    <br class="clear">
</div>
</div>
<br class="clear" />
</div>
<div id="footerWrapper">
<?php require_once 'footer.php'; ?>
</div>
</body>
</html>
